#include "led_zhuoyue_test.h"
// 
#include <string.h>
// lib
#include "debug.h"
// test
// #include "led_zhuoyue.h"
// #include "str_gbk_2312.h"
#include "task_led_ctrl.h"




char *GetDevIdStr(void){           // 获取设备ID字符串
    return "123456789012";
}
char *GetDevNameStr(void){         // 获取设备名称字符串
    return "Hoire";
}

uint32_t fnGetNodeSum(void){         // 获取指标总数
    return 2;
}
uint32_t fnGetMntrSum(uint32_t uNodeIndex){// 获取检测项总数
    return 4;
}

void GetDate(char *szBuffer){      // 获取日期字符串，形如 "2023-04-10"
    snprintf(szBuffer, 11, "2023-04-10");
}
void GetTime(char *szBuffer){      // 获取时间字符串，形如 "12:34"
    snprintf(szBuffer, 6, "12:34");
}
uint8_t GetWeekday(void){   // 获取星期字符串，形如 "星期一"
    return 1;
}

char *GetNodeName(uint32_t uNodeNum){ // 获取节点名称字符串
    return "Node_?";
}
char *GetMntrName(uint32_t uNodeNum, uint32_t uMntrNum){ // 获取检测项名称字符串
    return "Monitor_?";
}
char *GetMntrValue(uint32_t uNodeNum, uint32_t uMntrNum){ // 获取检测项值字符串
    return "12.34";
}
char *GetMntrUnit(uint32_t uNodeNum, uint32_t uMntrNum){ // 获取检测项单位字符串
    return "V";
}

void led_zhuoyue_test(void) {

    // _DEBUG_PRINT(DBG_STP, "初始化参数\n");
    // led_init_parm_zhuoyue(128, 64, 16, P3_75);

    // _DEBUG_PRINT(DBG_STP, "设置屏参\n");
    // led_set_screen_config_zhuoyue();

    // _DEBUG_PRINT(DBG_STP, "设置分区\n");
    // led_set_area_config_zhuoyue();

    // _DEBUG_PRINT(DBG_STP, "设置显示内容\n");s
    // led_set_area_display_content_zhuoyue(0, (uint8_t *)TEST_STR_1, strlen(TEST_STR_1));
    // led_set_area_display_content_zhuoyue(1, (uint8_t *)TEST_STR_2, strlen(TEST_STR_2));
    // led_set_area_display_content_zhuoyue(2, (uint8_t *)TEST_STR_3, strlen(TEST_STR_3));
    // led_set_area_display_content_zhuoyue(3, (uint8_t *)TEST_STR_4, strlen(TEST_STR_4));

    led_scr_set_base_parm(128, 64, 16, P3_75);
    led_scr_set_time_fn(GetDate, GetTime, GetWeekday);
    led_scr_set_ope_fn1(GetDevIdStr, GetDevNameStr);
    led_scr_set_ope_fn2(fnGetNodeSum, fnGetMntrSum);
    led_scr_set_ope_fn3(GetNodeName, GetMntrName, GetMntrValue, GetMntrUnit);
    
    task_led_control_state_machine();
}


